.class public Lcom/estrongs/android/pop/app/c0;
.super Ljava/lang/Object;
.source "ESDeviceMonitor.java"

# interfaces
.implements Lcom/estrongs/android/pop/zeroconf/g;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/android/pop/app/c0$e;,
        Lcom/estrongs/android/pop/app/c0$d;
    }
.end annotation


# static fields
.field private static e:Lcom/estrongs/android/pop/app/c0; = null

.field public static f:I = 0xa498

.field public static g:Ljava/lang/String; = "ESDevice"


# instance fields
.field private a:Lcom/estrongs/android/pop/zeroconf/h;

.field private b:Landroid/content/BroadcastReceiver;

.field private c:Ljava/lang/Object;

.field private d:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Lcom/estrongs/android/pop/app/c0$e;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method private constructor <init>()V
    .locals 3

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    .line 3
    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/c0;->c:Ljava/lang/Object;

    .line 4
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/c0;->d:Ljava/util/ArrayList;

    .line 5
    new-instance v0, Lcom/estrongs/android/pop/app/c0$a;

    invoke-direct {v0, p0}, Lcom/estrongs/android/pop/app/c0$a;-><init>(Lcom/estrongs/android/pop/app/c0;)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/c0;->b:Landroid/content/BroadcastReceiver;

    .line 6
    new-instance v0, Landroid/content/IntentFilter;

    invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V

    const-string v1, "android.net.conn.CONNECTIVITY_CHANGE"

    .line 7
    invoke-virtual {v0, v1}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V

    .line 8
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v1

    iget-object v2, p0, Lcom/estrongs/android/pop/app/c0;->b:Landroid/content/BroadcastReceiver;

    invoke-virtual {v1, v2, v0}, Landroid/app/Application;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/c0;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/c0;->e()V

    return-void
.end method

.method static synthetic b(Lcom/estrongs/android/pop/app/c0;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/c0;->h()V

    return-void
.end method

.method private c(Lcom/estrongs/android/pop/zeroconf/f;)Lcom/estrongs/android/pop/app/c0$d;
    .locals 3

    .line 8
    new-instance v0, Lcom/estrongs/android/pop/app/c0$d;

    invoke-direct {v0}, Lcom/estrongs/android/pop/app/c0$d;-><init>()V

    .line 9
    iget-object v1, p1, Lcom/estrongs/android/pop/zeroconf/f;->f:Ljava/net/Inet4Address;

    iput-object v1, v0, Lcom/estrongs/android/pop/app/c0$d;->a:Ljava/net/Inet4Address;

    .line 10
    invoke-virtual {p1}, Lcom/estrongs/android/pop/zeroconf/f;->b()Ljava/util/Map;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/estrongs/android/pop/app/c0$d;->a(Lcom/estrongs/android/pop/app/c0$d;Ljava/util/Map;)Ljava/util/Map;

    .line 11
    iget-object v1, p1, Lcom/estrongs/android/pop/zeroconf/f;->a:Ljava/lang/String;

    const-string v2, "-"

    invoke-virtual {v1, v2}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v1

    .line 12
    iget-object p1, p1, Lcom/estrongs/android/pop/zeroconf/f;->a:Ljava/lang/String;

    const/4 v2, 0x0

    invoke-virtual {p1, v2, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    iput-object p1, v0, Lcom/estrongs/android/pop/app/c0$d;->b:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic c(Lcom/estrongs/android/pop/app/c0;)Ljava/lang/Object;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/c0;->c:Ljava/lang/Object;

    return-object p0
.end method

.method static synthetic d(Lcom/estrongs/android/pop/app/c0;)Lcom/estrongs/android/pop/zeroconf/h;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    return-object p0
.end method

.method private d()V
    .locals 4

    .line 2
    :try_start_0
    new-instance v0, Lcom/estrongs/android/pop/zeroconf/h;

    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v1

    const/4 v2, 0x2

    invoke-direct {v0, v1, v2}, Lcom/estrongs/android/pop/zeroconf/h;-><init>(Landroid/content/Context;I)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    .line 3
    sget-object v1, Lcom/estrongs/android/pop/zeroconf/h;->q:Ljava/lang/String;

    sget-object v2, Lcom/estrongs/android/pop/app/c0;->g:Ljava/lang/String;

    sget v3, Lcom/estrongs/android/pop/app/c0;->f:I

    invoke-virtual {v0, v1, v2, v3}, Lcom/estrongs/android/pop/zeroconf/h;->a(Ljava/lang/String;Ljava/lang/String;I)Z

    .line 4
    iget-object v0, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    invoke-virtual {v0, p0}, Lcom/estrongs/android/pop/zeroconf/h;->a(Lcom/estrongs/android/pop/zeroconf/g;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 5
    iget-object v1, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    if-eqz v1, :cond_0

    .line 6
    invoke-virtual {v1}, Lcom/estrongs/android/pop/zeroconf/h;->a()V

    const/4 v1, 0x0

    .line 7
    iput-object v1, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    .line 8
    :cond_0
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :goto_0
    return-void
.end method

.method private e()V
    .locals 4

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/pop/app/c0;->c:Ljava/lang/Object;

    monitor-enter v0

    .line 3
    :try_start_0
    iget-object v1, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    if-nez v1, :cond_0

    .line 4
    monitor-exit v0

    return-void

    .line 5
    :cond_0
    iget-object v1, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    const/4 v2, 0x0

    .line 6
    iput-object v2, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    .line 7
    new-instance v2, Ljava/lang/Thread;

    new-instance v3, Lcom/estrongs/android/pop/app/c0$c;

    invoke-direct {v3, p0, v1}, Lcom/estrongs/android/pop/app/c0$c;-><init>(Lcom/estrongs/android/pop/app/c0;Lcom/estrongs/android/pop/zeroconf/h;)V

    invoke-direct {v2, v3}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 8
    invoke-virtual {v2}, Ljava/lang/Thread;->start()V

    .line 9
    monitor-exit v0

    return-void

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method static synthetic e(Lcom/estrongs/android/pop/app/c0;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/c0;->d()V

    return-void
.end method

.method public static f()Lcom/estrongs/android/pop/app/c0;
    .locals 1

    .line 1
    sget-object v0, Lcom/estrongs/android/pop/app/c0;->e:Lcom/estrongs/android/pop/app/c0;

    if-nez v0, :cond_0

    .line 2
    new-instance v0, Lcom/estrongs/android/pop/app/c0;

    invoke-direct {v0}, Lcom/estrongs/android/pop/app/c0;-><init>()V

    sput-object v0, Lcom/estrongs/android/pop/app/c0;->e:Lcom/estrongs/android/pop/app/c0;

    .line 3
    :cond_0
    sget-object v0, Lcom/estrongs/android/pop/app/c0;->e:Lcom/estrongs/android/pop/app/c0;

    return-object v0
.end method

.method public static g()V
    .locals 1

    .line 1
    invoke-static {}, Lcom/estrongs/android/pop/FexApplication;->n()Lcom/estrongs/android/pop/FexApplication;

    move-result-object v0

    invoke-virtual {v0}, Lcom/estrongs/android/pop/FexApplication;->i()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 2
    invoke-static {}, Lcom/estrongs/android/pop/app/c0;->f()Lcom/estrongs/android/pop/app/c0;

    :cond_0
    return-void
.end method

.method private h()V
    .locals 2

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/pop/app/c0;->c:Ljava/lang/Object;

    monitor-enter v0

    .line 2
    :try_start_0
    iget-object v1, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    if-eqz v1, :cond_0

    .line 3
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/c0;->e()V

    const/4 v1, 0x0

    .line 4
    iput-object v1, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    .line 5
    :cond_0
    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 6
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/estrongs/android/pop/app/c0$b;

    invoke-direct {v1, p0}, Lcom/estrongs/android/pop/app/c0$b;-><init>(Lcom/estrongs/android/pop/app/c0;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 7
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    return-void

    :catchall_0
    move-exception v1

    .line 8
    :try_start_1
    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1
.end method


# virtual methods
.method public a()V
    .locals 0

    .line 3
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/c0;->e()V

    return-void
.end method

.method public a(Lcom/estrongs/android/pop/app/c0$e;)V
    .locals 1

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/pop/app/c0;->d:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public a(Lcom/estrongs/android/pop/zeroconf/f;)V
    .locals 2

    .line 4
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/c0;->c(Lcom/estrongs/android/pop/zeroconf/f;)Lcom/estrongs/android/pop/app/c0$d;

    move-result-object p1

    .line 5
    iget-object v0, p0, Lcom/estrongs/android/pop/app/c0;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/estrongs/android/pop/app/c0$e;

    .line 6
    invoke-interface {v1, p1}, Lcom/estrongs/android/pop/app/c0$e;->a(Lcom/estrongs/android/pop/app/c0$d;)V

    goto :goto_0

    :cond_0
    return-void
.end method

.method public b()V
    .locals 2

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/pop/app/c0;->c:Ljava/lang/Object;

    monitor-enter v0

    .line 4
    :try_start_0
    iget-object v1, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    if-eqz v1, :cond_0

    .line 5
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/c0;->e()V

    const/4 v1, 0x0

    .line 6
    iput-object v1, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    .line 7
    :cond_0
    invoke-direct {p0}, Lcom/estrongs/android/pop/app/c0;->d()V

    .line 8
    monitor-exit v0

    return-void

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public b(Lcom/estrongs/android/pop/app/c0$e;)V
    .locals 1

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/pop/app/c0;->d:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->remove(Ljava/lang/Object;)Z

    return-void
.end method

.method public b(Lcom/estrongs/android/pop/zeroconf/f;)V
    .locals 2

    .line 9
    invoke-direct {p0, p1}, Lcom/estrongs/android/pop/app/c0;->c(Lcom/estrongs/android/pop/zeroconf/f;)Lcom/estrongs/android/pop/app/c0$d;

    move-result-object p1

    .line 10
    iget-object v0, p0, Lcom/estrongs/android/pop/app/c0;->d:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/estrongs/android/pop/app/c0$e;

    .line 11
    invoke-interface {v1, p1}, Lcom/estrongs/android/pop/app/c0$e;->b(Lcom/estrongs/android/pop/app/c0$d;)V

    goto :goto_0

    :cond_0
    return-void
.end method

.method public c()V
    .locals 4

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/pop/app/c0;->c:Ljava/lang/Object;

    monitor-enter v0

    .line 3
    :try_start_0
    iget-object v1, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    if-eqz v1, :cond_0

    .line 4
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 5
    sget-object v2, Lcom/estrongs/android/pop/zeroconf/h;->q:Ljava/lang/String;

    invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 6
    iget-object v2, p0, Lcom/estrongs/android/pop/app/c0;->a:Lcom/estrongs/android/pop/zeroconf/h;

    const/4 v3, 0x0

    invoke-virtual {v2, v1, v3}, Lcom/estrongs/android/pop/zeroconf/h;->a(Ljava/util/ArrayList;I)Ljava/util/ArrayList;

    .line 7
    :cond_0
    monitor-exit v0

    return-void

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method
